/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:49 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class BaivietEntity
    {
        public BaivietEntity()
        {
			m_pk_ibaivietid=0;
			m_fk_inguoivietid=0;
			m_snoidung="";
			m_fk_itainguyenid=0;
			m_dngaydang=DateTime.Now;
			m_itrangthai=0;
			m_fk_inguoicapnhat=0;
			m_dngaycapnhat=DateTime.Now;
        }
		private Int64 m_pk_ibaivietid;
		public Int64 PK_iBaivietID
		{
			get { return m_pk_ibaivietid ; }
			set { m_pk_ibaivietid = value; }
		}
		private Int64 m_fk_inguoivietid;
		public Int64 FK_iNguoivietID
		{
			get { return m_fk_inguoivietid ; }
			set { m_fk_inguoivietid = value; }
		}
		private String m_snoidung;
		public String sNoidung
		{
			get { return m_snoidung ; }
			set { m_snoidung = value; }
		}
        private String m_stenbaiviet;
        public String sTenbaiviet
        {
            get { return m_stenbaiviet; }
            set { m_stenbaiviet = value; }
        }
        private String m_stieude;
        public String sTieude
        {
            get { return m_stieude; }
            set { m_stieude = value; }
        }
        private String m_sghichu;
        public String sGhichu
        {
            get { return m_sghichu; }
            set { m_sghichu = value; }
        }
		private Int64 m_fk_itainguyenid;
		public Int64 FK_iTainguyenID
		{
			get { return m_fk_itainguyenid ; }
			set { m_fk_itainguyenid = value; }
		}
		private DateTime m_dngaydang;
		public DateTime dNgaydang
		{
			get { return m_dngaydang ; }
			set { m_dngaydang = value; }
		}
		private Int16 m_itrangthai;
		public Int16 iTrangthai
		{
			get { return m_itrangthai ; }
			set { m_itrangthai = value; }
		}
		private Int64 m_fk_inguoicapnhat;
		public Int64 FK_iNguoicapnhat
		{
			get { return m_fk_inguoicapnhat ; }
			set { m_fk_inguoicapnhat = value; }
		}
		private DateTime m_dngaycapnhat;
		public DateTime dNgaycapnhat
		{
			get { return m_dngaycapnhat ; }
			set { m_dngaycapnhat = value; }
		}

        #region Comparison
        public static List<BaivietEntity> Sort(List<BaivietEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(BaivietEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<BaivietEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<BaivietEntity> COMPARISON_PK_iBaivietID
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.PK_iBaivietID.CompareTo(other.PK_iBaivietID);
				};
			}
		}
		public static Comparison<BaivietEntity> COMPARISON_FK_iNguoivietID
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.FK_iNguoivietID.CompareTo(other.FK_iNguoivietID);
				};
			}
		}
		public static Comparison<BaivietEntity> COMPARISON_sNoidung
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.sNoidung.CompareTo(other.sNoidung);
				};
			}
		}
		public static Comparison<BaivietEntity> COMPARISON_FK_iTainguyenID
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.FK_iTainguyenID.CompareTo(other.FK_iTainguyenID);
				};
			}
		}
		public static Comparison<BaivietEntity> COMPARISON_dNgaydang
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.dNgaydang.CompareTo(other.dNgaydang);
				};
			}
		}
		public static Comparison<BaivietEntity> COMPARISON_iTrangthai
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.iTrangthai.CompareTo(other.iTrangthai);
				};
			}
		}
		public static Comparison<BaivietEntity> COMPARISON_FK_iNguoicapnhat
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.FK_iNguoicapnhat.CompareTo(other.FK_iNguoicapnhat);
				};
			}
		}
		public static Comparison<BaivietEntity> COMPARISON_dNgaycapnhat
		{
			get
			{
				return delegate(BaivietEntity entity,BaivietEntity other)
				{
					return entity.dNgaycapnhat.CompareTo(other.dNgaycapnhat);
				};
			}
		}
        #endregion
    }
}
